package com.twu.biblioteca.commands;

import com.twu.biblioteca.IOStream.Message;
import com.twu.biblioteca.library.Library;

import java.io.IOException;

public class ViewBooksCommand implements ICommand {

    private int commandId;

    public ViewBooksCommand(int commandId) {
        this.commandId = commandId;
    }

    public String toString() {
        return "view all books";
    }

    public void execute(Library library) throws IOException {
        Message message = library.viewAllBooksMessage();
        library.getIo().outputCommand(message);
    }

    public int getCommandId() {
        return commandId;
    }
}
